#include <linux/module.h>
#include <linux/kernel.h>
#include <linux/init.h>
#include <linux/proc_fs.h>
#include <linux/string.h>

MODULE_LICENSE("GPL");
MODULE_AUTHOR("Ryan Welton");
MODULE_DESCRIPTION("Mimics CVE-2014-3153");

typedef struct {
    char propertyA[30];
    int propertB;
    struct list_head list; /* kernel's list structure */
} Widget;

Widget * widgetList;

static int __init futex_init(void)
{
    printk(KERN_INFO "mock buggy futex: loading module\n");
    widgetList = kmalloc(sizeof(Widget), GFP_KERNEL);

    return 0;
}

static void __exit futex_exit(void)
{
    printk(KERN_INFO "mock futex: unloading module\n");
}

module_init(futex_init);
module_exit(futex_exit);
